package com.cskaoyan.user.api;

import com.cskaoyan.mall.commons.result.ServiceCallResponse;
import com.cskaoyan.mall.commons.result.ServiceCallResponseUtil;
import com.cskaoyan.mall.user.AddressOrderDto;
import com.cskaoyan.user.service.IAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @since 2022/08/25 17:19
 * @author sunxuJ
 */
@RestController
public class OrderApi {

    @Autowired
    IAddressService addressService;

    @GetMapping("/order/getAddress")
    public ServiceCallResponse<AddressOrderDto> queryAddressByAddressId(@RequestParam("id") Long id){
     AddressOrderDto address = addressService.queryAddressByAddressId(id);
     return new ServiceCallResponseUtil<AddressOrderDto>().ok(address);
    }
}
